package com.example.commom.util.remote;

/**
 * 远程调用链
 * @author: bebm
 * @date: 2022/4/2 16:53
 * @description:
 */
public interface RemoteTransferChain {

    /**
     *
     * @param transferHandler
     * @param remoteRollbackHandler
     * @return
     */
    RemoteTransferChain next(RemoteTransferHandler transferHandler,RemoteRollbackHandler remoteRollbackHandler);

    RemoteTransferChain nextBeforeCallback(RemoteTransferCallbackHandler remoteTransferCallbackHandler, RemoteRollbackHandler remoteRollbackHandler);

    RemoteTransferChain nextBeforeCallback(RemoteTransferCallbackHandler remoteTransferCallbackHandler,RemoteRollbackHandler remoteRollbackHandler, Integer resultIndex);

    <T> T getExecuteResult(int index, Class<T> clz);

    void execute();

}
